﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:vs="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.11.0"
                   
                    >
    <!--
    
     Background="{DynamicResource {x:Static vs:VsBrushes.ToolWindowBackgroundKey}}"
                    Foreground="{DynamicResource {x:Static vs:VsBrushes.WindowTextKey}}"
  *****************************************************************************
  BRUSHES
  *****************************************************************************
  -->

    <!-- #Brushes -->

    <SolidColorBrush x:Key="DataGridHeaderBackgroundBrush" Color="LightGray"/>
    <SolidColorBrush x:Key="DataGridHeaderMouseOverBackgroundBrush" Color="White"/>
    <SolidColorBrush x:Key="DataGridHeaderMouseOverForegroudnBrush" Color="DarkGray"/>
    <SolidColorBrush x:Key="DataGridHeaderBorderBrush" Color="LightGray"/>
    <SolidColorBrush x:Key="DataGridHeaderSortedBorderBrush" Color="{DynamicResource {x:Static vs:VsColors.ToolWindowBackgroundKey}}"/>
    <SolidColorBrush x:Key="DataGridHeaderSortedBackgroundBrush" Color="{DynamicResource {x:Static vs:VsColors.ToolWindowBackgroundKey}}"/>

    <SolidColorBrush x:Key="RowBackgroundSelectedBrush" >
        <!--
        StartPoint="0,0" EndPoint="0,1"
        <GradientStop Color="#4F8CC7" Offset="0" />
        <GradientStop Color="#1C4B7C" Offset="0.7" />
        <GradientStop Color="#042D5B" Offset="1" />-->
    </SolidColorBrush>

    <SolidColorBrush x:Key="RowHeaderBackgroundBrush" Color="LightGray" />
    <!--
    <LinearGradientBrush x:Key="DataGridHeaderBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#739D20" Offset="0" />
        <GradientStop Color="#4F8300" Offset="1" />
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="DataGridHeaderMouseOverBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#90B321" Offset="0" />
        <GradientStop Color="#66A002" Offset="1" />
    </LinearGradientBrush>


    <LinearGradientBrush x:Key="DataGridHeaderBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#9ECD42" Offset="0" />
        <GradientStop Color="#3D5808" Offset="1" />
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="DataGridHeaderSortedBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#B58801" Offset="0" />
        <GradientStop Color="#681900" Offset="1" />
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="DataGridHeaderSortedBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#C46007" Offset="0" />
        <GradientStop Color="#AF2600" Offset="1" />
    </LinearGradientBrush>
-->

    <SolidColorBrush x:Key="DataGridBackgroundBrush" Color="#FFFFFFFF" />
    <SolidColorBrush x:Key="DataGridSelectedBrush" Color="#3E4955" />

    <SolidColorBrush x:Key="DataGridSelectedForegroundBrush" Color="#FFFFFF" />


    <SolidColorBrush x:Key="DataGridValidationForegroundBrush" Color="Red" />
    <SolidColorBrush x:Key="DataGridValidationBackgroundBrush" Color="Transparent" />



    <SolidColorBrush x:Key="RowBackgroundBrush" Color="#44FFFF00" />
    <SolidColorBrush x:Key="RowBackgroundAlternateBrush" Color="#443D7EC5" />
    <SolidColorBrush x:Key="RowBackgroundAlternationIndex2Brush" Color="#44FF0000" />
    <SolidColorBrush x:Key="RowBackgroundAlternationIndex3Brush" Color="#44CCCCCC" />


    <SolidColorBrush x:Key="DataGridHorizontalLinesBrush" Color="DarkGray" />


    <SolidColorBrush x:Key="RowHeaderIsMouseOverBrush" Color="White" />
    <!--<LinearGradientBrush x:Key="XXXDataGridHeaderSortedBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#B58801" Offset="0" />
        <GradientStop Color="#681900" Offset="1" />
    </LinearGradientBrush>-->




    <Style x:Key="PowersourceCellStyle" TargetType="{x:Type DataGridCell}">
        <Setter Property="BorderBrush" Value="LightGray"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
    </Style>

        <BooleanToVisibilityConverter x:Key="bool2VisibilityConverter" />
    <Style x:Key="ColumnHeaderGripperStyle" TargetType="{x:Type Thumb}">
        <Setter Property="Width" Value="8"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Cursor" Value="SizeWE"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border Padding="{TemplateBinding Padding}"
                    Background="{TemplateBinding Background}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!-- ********************************************** -->

    <Style x:Key="RowHeaderStyleTeams" TargetType="DataGridRowHeader">
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <TextBlock Text="{Binding Path=Item[0], RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type DataGridRow}}}"/>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="RowHeaderStyleTimeFrames" TargetType="DataGridRowHeader">
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <TextBlock Text="{Binding Path=Item[0], RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type DataGridRow}}}"/>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="DatagridColumnHeaderCustomTemplateStyle" 
         TargetType="{x:Type DataGridColumnHeader}">
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="MinWidth" Value="0" />
        <Setter Property="MinHeight" Value="28" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Border x:Name="BackgroundBorder" BorderThickness="0,1,0,1" 
                              Background="{StaticResource DataGridHeaderSortedBackgroundBrush}" 
                              BorderBrush="{StaticResource DataGridHeaderSortedBorderBrush}" 
                                
                              Grid.ColumnSpan="2" />
                        <ContentPresenter Margin="6,3,6,3" VerticalAlignment="Center" />
                        <Path x:Name="SortArrow" Visibility="Collapsed" Data="M0,0 L1,0 0.5,1 z" Stretch="Fill" 
                            Grid.Column="1" Width="8" Height="6" Fill="White" Margin="0,0,8,0" 
                            VerticalAlignment="Center" RenderTransformOrigin="0.5,0.4" />
                        <Rectangle Width="1" Fill="#AAC377" HorizontalAlignment="Right" Grid.ColumnSpan="2" />

                        <Rectangle Width="1" Margin="0,0,1,0" Fill="#425B10" 
                                 HorizontalAlignment="Right" Grid.ColumnSpan="2" />
                        <Thumb x:Name="PART_LeftHeaderGripper" HorizontalAlignment="Left" 
                             Style="{StaticResource ColumnHeaderGripperStyle}"/>
                        <Thumb x:Name="PART_RightHeaderGripper" HorizontalAlignment="Right" 
                             Style="{StaticResource ColumnHeaderGripperStyle}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="SortDirection" Value="{x:Null}">
                            <Setter TargetName="BackgroundBorder" Property="Background" 
                                  Value="{DynamicResource DataGridHeaderBackgroundBrush}" />
                            <Setter TargetName="BackgroundBorder" Property="BorderBrush"  
                                  Value="Transparent" />
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsMouseOver" Value="True" />
                                <Condition Property="SortDirection" Value="{x:Null}" />
                            </MultiTrigger.Conditions>
                            <Setter Property="Background" TargetName="BackgroundBorder" 
                                  Value="{StaticResource DataGridHeaderMouseOverBackgroundBrush}" />
                            <Setter Property="BorderBrush" TargetName="BackgroundBorder" 
                                  Value="{StaticResource DataGridHeaderBorderBrush}" />
                            <Setter  Property="Foreground" 
                                  Value="{StaticResource DataGridHeaderMouseOverForegroudnBrush}" />
                        </MultiTrigger>
                        <!--<MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsMouseOver" Value="true" />
                                <Condition Property="SortDirection" Value="{x:Null}" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="BackgroundBorder" Property="Background" 
                                  Value="{StaticResource DataGridHeaderMouseOverBackgroundBrush}" />
                            <Setter TargetName="BackgroundBorder" Property="BorderBrush" 
                                  Value="{StaticResource DataGridHeaderBorderBrush}" />
                            <Setter  Property="Foreground" 
                                  Value="{StaticResource DataGridHeaderMouseOverForegroudnBrush}" />
                        </MultiTrigger>-->

                        <Trigger Property="SortDirection" Value="Ascending">
                            <Setter TargetName="SortArrow" Property="Visibility" Value="Visible" />
                            <Setter TargetName="SortArrow" Property="RenderTransform">
                                <Setter.Value>
                                    <RotateTransform Angle="180" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="SortDirection" Value="Descending">
                            <Setter TargetName="SortArrow" Property="Visibility" Value="Visible" />
                        </Trigger>
                        <Trigger Property="DisplayIndex" Value="0">
                            <Setter Property="Visibility" Value="Collapsed" 
                                  TargetName="PART_LeftHeaderGripper"></Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>